package main

func main() {
	println(minMoves([]int{1, 1000000000, 1}))
}

/**
 *	minMoves
 *	@Description: 数学
 *	@param nums []int
 *	@return step int
 */
func minMoves(nums []int) (step int) {
	min := nums[0]
	for _, v := range nums[1:] {
		if v < min {
			min = v
		}
	}
	for _, v := range nums {
		step += v - min
	}
	return
}
